The micro service architecture
pattern is a distributed system running on different
machines as a process or a service. It is important for the components of the
system to interact with one another for the effective handling of client requests. Services often collaborate
to handle the requests. Consequently, they must use an inter
process communication protocol while implementing a system based
on the micro service architecture. How communication between microservices
happen is an important decision to make. The two types of microservices
communication are synchronous and asynchronous. In synchronous communication,
one micro service communicates with another micro service through a REST
endpoint over the HTTP protocol. In this approach, the calling service can
wait until the collar service responds. Here while serving the client request, a chain of requests is created
between microservices. Here's an example of
synchronous communication in asynchronous communication. In a Asynchronous Communication one
micro service communicates with another micro service using
asynchronous messages or HTTP polling. The calling service will not wait for
a response from the callers service. Asynchronous communication and
microservices can be accomplished through message brokers like Apache,
Kafka and RabbitMQ. Here's an example of
asynchronous communication.